package com.huishi.service.impl;

import com.huishi.entity.DataSource;
import com.huishi.enums.DataSourceType;
import com.huishi.mapper.DataSourceMapper;
import com.huishi.service.DataSyncService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class DataSyncServiceImpl implements DataSyncService {

    @Autowired
    private DataSourceMapper dataSourceMapper;

    public DataSyncServiceImpl() {
        System.out.println("创建DataSyncServiceImpl");
    }

    @Override
    @com.huishi.annotation.DataSource(value = DataSourceType.SLAVE)
    public List<DataSource> getAllDataSource() {
        return dataSourceMapper.getAllDataSource();
    }
}
